#include "zxlog.hpp"
void loggerTest(const std::string &logger_name) {
     zxlog::Logger::ptr lp = zxlog::getLogger(logger_name);
     LOGF("------------example--------------------");
     lp->debug("%s", "logger->debug");
     lp->info("%s", "logger->info");
     lp->warn("%s", "logger->warn");
     lp->error("%s", "logger->error");
     lp->fatal("%s", "logger->fatal");
     DEBUG(lp, "%s", "LOG_DEBUG");
     INFO(lp, "%s", "LOG_INFO");
     WARN(lp, "%s", "LOG_WARN");
     ERROR(lp, "%s", "LOG_ERROR");
     FATAL(lp, "%s", "LOG_FATAL");
     LOGF("---------------------------------------");
     
     std::string log_msg = "hello bitejiuyeke-";
     size_t fsize = 0;
     size_t count = 0;
     while(count < 100000) {
     std::string msg = log_msg + std::to_string(count++);
     lp->error("%s", msg.c_str());
     }
}
int main(int argc, char *argv[])
{
     //实例化全局⽇志器建造者
    zxlog::BuildLogger::ptr builder = std::make_shared<zxlog::GlobalBuildLogger>();
    builder->BuildLoggerName("SyncLogger");
    builder->BuildLoggerType(zxlog::Logger::LoggerType::SYNC_LOGGER);
    builder->BuildLoggerLevel(zxlog::LogLevel::Value::DEBUG);
    builder->BuildSinks<zxlog::StdoutSink>();
    builder->BuildSinks<zxlog::FileSink>("tmp.log");
    builder->BuildSinks<zxlog::RollSink>("a/test",1024*1024)
;
    builder->Builder();
    loggerTest("SyncLogger");
     return 0;
}
